﻿@page
@inherits Acesoft.Web.UI.RazorPages.WebPage
@{
    Layout = "_shared/edit";
    ViewData["Title"] = "编辑";

    Ace.View().Id("view").Ajax(ds => ds.DataSource("sys.version").Form(new {
        client_id = App.GetQuery("clientid", ""),
        version = "",
        pubdate = DateTime.Now.ToString("yyyy-MM-dd"),
        package = "",
        md5 = "",
        changelog = "",
        current = 1,
        force = 0,
        remark = "",
        type = 2
    }).HttpSave()).Content(
        @<div class="container-fluid">
            <div class="row">
                <div class="col-xs-2 text-r"><span class="cr-red">*</span> 版本号：</div>
                <div class="col-xs-6">@Ace.TextBox().Name("version").Width("100%").Required().ValidType("length[7,7]")</div>
                <div class="col-xs-4"><span class="text-warning">必须填写x.x.x.x格式</span></div>
            </div>
            <div class="row">
                <div class="col-xs-2 text-r"><span class="cr-red">*</span> 发布日期：</div>
                <div class="col-xs-6">@Ace.DateBox().Name("pubdate").Width("100%").Required()</div>
                <div class="col-xs-4"></div>
            </div>
            <div class="row h80">
                <div class="col-xs-2 text-r"><span class="cr-red">*</span> 发行包：</div>
                <div class="col-xs-6">
                    @(Ace.UploadBox().Name("package").Width("100%").Max(1).Filters(f =>
                    {
                        f.max_file_size = "30mb";
                        f.mime_types.Add(new MineType { title = "Android package", extensions = "apk" });
                    }).OssBucket("goldcloud").Dir("file"))
                </div>
                <div class="col-xs-4"><span class="text-warning">请上传Android发行包apk文件</span></div>
            </div>
            <div class="row">
                <div class="col-xs-2 text-r"><span class="cr-red"></span> MD5核验：</div>
                <div class="col-xs-6">@Ace.TextBox().Name("md5").Width("100%")</div>
                <div class="col-xs-4"></div>
            </div>
            <div class="row">
                <div class="col-xs-2 text-r"><span class="cr-red"></span> 更新说明：</div>
                <div class="col-xs-6">@Ace.TextArea().Name("changelog").Width("100%").Height("80px")</div>
                <div class="col-xs-4"></div>
            </div>
            <div class="row">
                <div class="col-xs-2 text-r"><span class="cr-red"></span> 设置：</div>
                <div class="col-xs-6">
                    @Ace.CheckBox().Name("current").Text("设为当前版本")&nbsp;&nbsp;
                    @Ace.CheckBox().Name("force").Text("设为强制更新")
                </div>
                <div class="col-xs-4"><span class="text-warning">有且只有一个当前版本</span></div>
            </div>
            <div class="row">
                <div class="col-xs-2 text-r">备注：</div>
                <div class="col-xs-6">@Ace.TextBox().Name("remark").Width("100%")</div>
                <div class="col-xs-4"></div>
            </div>
            @Html.AntiForgeryToken()
        </div>
    ).Render();
}
@section startup {
    <script>
    </script>
}